#!/usr/bin/env python


origin = [256, 513, 473, 390, 519, 108, 394, 151, 524, 141, 173, 451, 350, 278, 409, 537, 284, 90, 416, 474, 290, 164, 262, 156, 135, 300, 429, 115, 53, 439, 184, 313, 266, 446, 575, 320, 322, 579, 66, 569, 199, 586, 333, 206, 548, 78, 87, 216, 601, 602, 557, 540, 610, 100, 358, 487, 233, 618, 363, 236, 493, 61, 370, 499, 246, 378, 127, 341]


raw_info = "\x1b\x58HiWiFi_4AA762\x00qwertyuiop\x00"

rilen = len(raw_info)

encoded = [0] * ((8*rilen-1) /3 +1)

for i in range(0, 8*rilen):
    if (ord(raw_info[i/8]) >> (i%8)) &1:
        encoded[i/3] |= 1<<(i%3)

for i in range(len(encoded)):
    encoded[i] += 8*i + 50


print encoded
print set(encoded) - set(origin)
print set(origin) - set(encoded)
